package com.hw.paltfrom.controller.weight;
import com.hw.paltfrom.pack.ResponseResult;
import com.hw.paltfrom.pojo.HwDataEnterpriseHistory;
import com.hw.paltfrom.rescode.HWSystemCode;
import com.hw.paltfrom.service.weight.DataEnterpriseHistoryService;
import com.hw.paltfrom.utils.VerifyUtil;
import com.hw.paltfrom.vo.DataEnterpriseHistoryVo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;

/**
 *01 称重检测（源头企业数据监管）
 * 崔孟超
 * 2019年11月6日15:34:31
 */
@RestController
@RequestMapping(value = "/DataEnterpriseHistory")
public class DataEnterpriseHistoryController {
    @Autowired
    private DataEnterpriseHistoryService dataEnterpriseHistoryService;


    /**
     * 源头企业遍历+分页+模糊查询+刷新功能
     * @param Pojo
     * @return
     */
    @RequestMapping("/queryAllList")
    public Map<String, Object>  queryAllList(HwDataEnterpriseHistory Pojo, DataEnterpriseHistoryVo vo){
        Boolean flag = VerifyUtil.verifyParams(vo);
        if (!flag) {
            return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
        }
        return dataEnterpriseHistoryService.query(Pojo,vo);
    }

    /**
     * 详情+单个修改展示
     *
     * @param Pojo
     * @return
     */
    @RequestMapping(value = "/particulars")
    public Map<String, Object> particulars(HwDataEnterpriseHistory Pojo) {

        return dataEnterpriseHistoryService.particulars(Pojo);
    }

    /**
     * 源头企业的添加
     * @param pojo
     * @return
     */
    @RequestMapping(value = "/insert")
    public Map<String, Object> userAdd(HwDataEnterpriseHistory pojo) {
        Boolean flag = VerifyUtil.verifyParams(pojo);
        if (!flag) {
            return ResponseResult.fail(HWSystemCode.PARAMS_ERROR);
        }
        return dataEnterpriseHistoryService.insert(pojo);
    }

}
